package com.tohours.aia.constants;

import java.util.Map;
import java.util.TreeMap;


public class Constants {

	//附件相关
	private static final Long FILE_UPLOAD_SIZE = 5 * 1024 * 1024L;
	private static final Long FILE_UPLOAD_IMAGE_SIZE = 2 * 1024 * 1024L;
	private static final String FILE_UPLOAD_IMAGE_TYPE = "jpg,jpeg,gif,png";
	private static final String FILE_UPLOAD_TYPE = "jpg,jpeg,gif,png,doc,rar,xls,docs,xlsx";
	public static Long getFileUploadSize(){
		return FILE_UPLOAD_SIZE;
	}
	public static Long getFileUploadImageSize(){
		return FILE_UPLOAD_IMAGE_SIZE;
	}
	public static String getFileUploadImageType(){
		return FILE_UPLOAD_IMAGE_TYPE;
	}
	public static String getFileUploadType(){
		return FILE_UPLOAD_TYPE;
	}
	
	public static final Long GIFT_YHD = 1L;
	public static final Long GIFT_JD = 2L;
	public static final Long GIFT_HAAGENDAZS = 3L;
	public static final Long GIFT_STARBUCKS = 4L;
	public static final Long GIFT_HOTEL = 5L;
	public static final Long GIFT_PARK= 6L;
	public static final Long GIFT_IPHONE5S= 7L;
	public static final Long GIFT_BANYANTREE= 8L;
	
	public static Map<Long, String> GIFT = new TreeMap<Long, String>();
	
	static{
		GIFT.put(GIFT_YHD, "1号店优惠券 (满100减10)");
		GIFT.put(GIFT_JD, "京东商城电子现金券 (100元)");
		GIFT.put(GIFT_HAAGENDAZS, "哈根达斯冰淇淋券 (100元)");
		GIFT.put(GIFT_STARBUCKS, "星巴克中杯券(1张)");
		GIFT.put(GIFT_HOTEL, "五星酒店自助餐 (双人)");
		GIFT.put(GIFT_PARK, "主题公园门票 (家庭套票)");
		GIFT.put(GIFT_IPHONE5S, "IPHONE5S （土豪金）(1台)");
		GIFT.put(GIFT_BANYANTREE, "悦榕庄奢华体验 (1晚)");
	}
	public static Long[] GIFT_PERCENT = {0L, 1000L, 500L, 500L, 300L, 300L, 5L, 50L};
	private static final String[] PARENT_CATALOG = {"政府机构","餐饮美食","健康医疗","公共服务","教育机构","文化","体育","出行游玩","电子地图"};
	public static boolean isParentCatalog(String catalog){
		for(String cata : PARENT_CATALOG){
			if(cata.equals(catalog)){
				return true;
			}
		}
		return false;
	}
	
	public static boolean isAdmin(String userId){
		return "0".equals(userId);
	}
	
	public static final String SESSION_USER_NAME = "userName";
	public static final String SESSION_USER_ID = "userId";
	public static final String SESSION_USER = "user";
}
